<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>用户注册</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<SCRIPT type="text/javascript" src="js/register_validate.js"></SCRIPT>
  </head>
  
  <body>
    <div id="container">
		<jsp:include page="/header.jsp"></jsp:include>
		<div id="wrapper">
			<div id="content">
				<h1>注册新用户</h1><hr/>
					<table id="registerTable">
					<s:form action="user/user_add" method="post" theme="simple" onsubmit="return testForm();">
						<s:token></s:token>
						<span><s:fielderror cssClass="error"/></span>
						<tr>
							<td>用户名：</td>
							<td><s:textfield name="user.userID" id="userID" onblur="checkUserID()"/>
							<span id="userID.info" class="error">&nbsp;&nbsp;*</span></td>
						</tr>
						<tr><td></td><td><span class="registerInfo">用户名为本站的账号，为3-20个字符或数字，建议使用本校OJ账号作为您的用户名</span></td></tr>
						<tr>
							<td>密码：</td>
							<td><s:password name="user.password" id="password" onblur="checkPassword()"/>
							<span id="password.info" class="error">&nbsp;&nbsp;*</span></td>
						</tr>
						<tr><td></td><td><span class="registerInfo">密码不允许有非法字符，不能以数字开头，且长度在6-20个字符之间</span></td></tr>
						<tr>
							<td>再次输入密码：</td>
							<td><s:password name="rptPassword" id="rptPassword" onblur="checkRptPassword()"/>
							<span id="rptPassword.info" class="error">&nbsp;&nbsp;*</span></td>
						</tr>
						<tr><td></td><td><span class="registerInfo">重新输入您的密码</span></td></tr>
						
						<tr>
							<td>选择学院专业：</td>
							<td><s:doubleselect
							list="maps.keySet()"
			     			name="user.academy"
			     			headerKey="adademy"
			     			headerValue="选择你的学院...."
			                doubleName="user.majore" 
			                doubleList="maps[top]"/></td>
						</tr>
						
						<tr>
							<td>班级：</td>
							<td><s:textfield name="user.clazz" id="clazz" onblur="checkClazz()"></s:textfield>
							<span id="clazz.info" class="error">&nbsp;&nbsp;*</span></td>
						</tr>
						<tr><td></td><td><span class="registerInfo">班级请按照'计科0704'的格式填写</span></td></tr>
						
						<tr>
							<td>学号：</td>
							<td><s:textfield name="user.sno" id="sno" onblur="checkSno()"/>
							<span id="sno.info" class="error">&nbsp;&nbsp;*</span></td>
						</tr>
						<tr><td></td><td><span class="registerInfo">请正确填写学号</span></td></tr>
						<tr>
							<td>真实姓名：</td>
							<td><s:textfield name="user.name" id="realname" onblur="checkRealName()"></s:textfield>
							<span id="realname.info" class="error">&nbsp;&nbsp;*</span></td>
						</tr>
						<tr><td></td><td><span class="registerInfo">填写您的真实姓名</span></td></tr>
						
						
						<tr>
							<td>性别：</td>
							<td><s:radio list="{'男','女'}" name="user.sex" value="'男'"></s:radio></td>
							<td></td>
						</tr>
						
						<tr>
							<td>联系方式：</td>
							<td><s:textfield name="user.phone" id="phone" onblur="checkPhone()"></s:textfield>
							<span id="phone.info" class="error">&nbsp;&nbsp;*</span></td>
						</tr>
						<tr><td></td><td><span class="registerInfo">请填写正确的联系方式</span></td></tr>
						
						<tr>
							<td>邮箱：</td>
							<td><s:textfield label="邮箱" name="user.email" id="email" onblur="checkEmail()"></s:textfield>
							<span id="email.info" class="error">&nbsp;&nbsp;*</span></td>
						</tr>
						<tr><td></td><td><span class="registerInfo">填写正确的邮箱地址，以便接受重要的通知</span></td></tr>
						
						<tr>
							<td>qq：</td>
							<td><s:textfield label="qq" name="user.qq" id="qq"></s:textfield></td>
							<td></td>
						</tr>
						
						<tr>
							<td>个人特长：</td>
							<td><s:textarea name="user.goodat" rows="5" cols="55"></s:textarea></td>
							<td></td>
						</tr>
						<tr><td></td><td><span class="registerInfo">个人特长填写自己擅长的算法等</span></td></tr>
						<tr>
							<td></td><td><s:submit value="提交" cssClass="btn"/>
							<input type="reset" value="重置" class="btn" onclick="set()"/></td>
						</tr>
					</s:form>
					</table>
			</div>
			<div id="sidebar">
			<jsp:include page="/sidebar.jsp"></jsp:include>
			</div>
		</div>
		
		<jsp:include page="/footer.jsp"></jsp:include>
	</div>	
  	
  </body>
</html>
